# user.py
from price_strategy import PriceStrategy

# 用户行为类（桥接类）
class User:
    def __init__(self, name: str, price_strategy: PriceStrategy):
        self.name = name
        self.price_strategy = price_strategy

    def display(self):
        raise NotImplementedError()  # 子类实现展示信息方法

    def calculate_price(self, base_price: float) -> float:
        return self.price_strategy.calculate_price(base_price)

# 具体用户类：普通用户
class NormalUser(User):
    def display(self):
        print(f"普通用户：{self.name}")

# 具体用户类：VIP用户
class VIPUser(User):
    def display(self):
        print(f"VIP用户：{self.name}")

# 具体用户类：金卡用户
class GoldUser(User):
    def display(self):
        print(f"金卡用户：{self.name}")

# 具体用户类：银卡用户
class SilverUser(User):
    def display(self):
        print(f"银卡用户：{self.name}")

